﻿using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using Dune.Business.Domain.Application;
using Dune.Business.Domain.Users;
using Dune.Business.Security;
using Dune.Common.Services;

namespace Dune.Web.AppCode
{
    public class PersonManager : IPersonManager
    {
        private const int DEFAULT_EMPLOYEE_ID = -1;

        #region IPersonManager Members

        public User GetCurrentPerson()
        {
            UserHolder holder = Locator.GetService<IContextObjects>().Get<UserHolder>();
            return holder.Object;
        }


        public bool IsDefinedCurrentPerson()
        {
            UserHolder holder = Locator.GetService<IContextObjects>().Get<UserHolder>();
            return !(holder == null || holder.Object == null);
        }

        public User GetDefaultPerson()
        {
          //  return Locator.GetService<IEmployeeManager>().Load(DEFAULT_EMPLOYEE_ID);
            return null;
        }

        #endregion
    }
}
